Multi-module Java Maven application designed for testing static analysis tools. This application intentionally contains a vulnerable dependency (Apache Commons Text 1.9) with clear call chains from API endpoints to the vulnerable code.
This application is specifically designed to test the autovulcanx-core static analyzer engine's ability to:
- Detect vulnerable dependencies (CVE-2022-42889)
- Track call graphs from entry points to vulnerable code
- Analyze method chains across multiple modules
- Identify data flow through complex architectures
- Component: Apache Commons Text 1.9
- Class:
org.apache.commons.text.StringSubstitutor - Severity: Critical (CVSS 9.8)
- Issue: Script engine code execution via variable interpolation
- Exploit:
${script:javascript:java.lang.Runtime.getRuntime().exec("calc")}
petstore-parent/
├── petstore-domain/ # Entity classes (Pet, Customer, Order)
├── petstore-data/ # Data access with VULNERABLE TemplateProcessor
├── petstore-service/ # Business logic layer
└── petstore-api/ # REST controllers (Entry points)
petstore-api
└─> petstore-service
└─> petstore-data
├─> petstore-domain
└─> commons-text:1.9 (VULNERABLE)
PetController.getPetAdvertisement()
└─> PetService.generatePetAdvertisement()
└─> PetRepository.generatePetDescription()
└─> TemplateProcessor.processTemplate()
└─> StringSubstitutor.replace() ⚠️ VULNERABLE
PetController.createCustomListing(id, customFormat)
└─> PetService.createCustomPetListing()
└─> PetRepository.generatePetListing()
└─> TemplateProcessor.processTemplate()
└─> StringSubstitutor.replace() ⚠️ VULNERABLE
CustomerController.sendNotification(id, messageTemplate)
└─> CustomerService.sendCustomNotification()
└─> CustomerRepository.formatNotification()
└─> TemplateProcessor.formatMessage()
└─> StringSubstitutor.replace() ⚠️ VULNERABLE
OrderController.processNotes(id, notesTemplate)
└─> OrderService.processSpecialOrderNotes()
└─> OrderRepository.processOrderNotes()
└─> TemplateProcessor.processTemplateWithDefaults()
└─> StringSubstitutor.createInterpolator() ⚠️ HIGHLY VULNERABLE
OrderController.getCompleteReport(id)
└─> OrderService.generateCompleteOrderReport()
├─> OrderRepository.generateOrderConfirmation() ───┐
├─> CustomerRepository.generateWelcomeMessage() ───┼─> All lead to
└─> PetRepository.generatePetDescription() ────────┘ StringSubstitutor ⚠️
- Java 11 or higher
- Maven 3.6 or higher
# Build all modules
mvn clean install
# Build without tests
mvn clean install -DskipTests
# Run the application
cd petstore-api
mvn exec:java -Dexec.mainClass="com.petstore.api.PetStoreApplication"# From project root
cd petstore-api\target
java -jar petstore-api-1.0-SNAPSHOT.jar
# Or using Maven
mvn -pl petstore-api exec:javaThe static analyzer should detect:
-
Vulnerable Dependency
- Apache Commons Text 1.9 (CVE-2022-42889)
-
Vulnerable Usage Points (at minimum):
TemplateProcessor.processTemplate()TemplateProcessor.processTemplateWithDefaults()TemplateProcessor.formatMessage()
-
Entry Points with Vulnerable Chains:
PetController.createCustomListing()- User-controlled templateCustomerController.sendNotification()- User-controlled templateOrderController.processNotes()- User-controlled template (most dangerous)OrderController.getCompleteReport()- Complex multi-chain
-
Data Flow Analysis:
- Track user input (customFormat, messageTemplate, notesTemplate)
- Follow through service layer
- Identify repository calls
- Trace to vulnerable StringSubstitutor
Tests analyzer's ability to track dependencies across Maven modules.
Multiple levels of method calls before reaching vulnerable code.
Several endpoints accept user-provided templates that flow to vulnerable code.
Multiple paths and branches leading to the same vulnerable dependency.
Batch processing methods that call vulnerable code in loops.
Various API endpoints that all lead to the vulnerability through different paths.
- DO NOT deploy to production
- DO NOT expose to untrusted networks
- USE ONLY for security testing and research
- ALWAYS run in isolated environments
This is a test application for security research purposes only.
For questions about this test application, please refer to the project documentation.